home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / PowerUpDrain.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  771 b   |  32 lines

  1. class classes.fx.PowerUpDrain
  2. {
  3.    var x;
  4.    var y;
  5.    var clip;
  6.    var xMov;
  7.    var yMov;
  8.    var Name = "powerUpDrain";
  9.    function PowerUpDrain(px, py, pid)
  10.    {
  11.       this.x = px;
  12.       this.y = py;
  13.       _root.d = _root.d + 1;
  14.       this.clip = _root.attachMovie("powerUpDrain","powerUpDrainClip",_root.d + 499990);
  15.       this.clip._x = this.x;
  16.       this.clip._y = this.y;
  17.       this.xMov = _root.randRange2(-2,2);
  18.       this.yMov = _root.randRange2(-1,-3);
  19.    }
  20.    function main()
  21.    {
  22.       if(this.x > 1050 || this.x < -50 || this.y < -50 || this.y > 650)
  23.       {
  24.          _root.removeFX("powerUpDrain");
  25.       }
  26.       this.x += this.xMov;
  27.       this.y += this.yMov;
  28.       this.clip._x = this.x;
  29.       this.clip._y = this.y;
  30.    }
  31. }
  32.